/*
 * StreamOperationSlot.cpp
 *
 *  Created on: 2011-3-31
 *      Author: hao
 */

#include "StreamOperationSlot.h"

void StreamOperationSlot::addOperationPlugin(StreamOperationPlugin* pPlugin){
    vOperationList.push_back( pPlugin );
}

void StreamOperationSlot::delOperationPlugin(StreamOperationPlugin* pPlugin){
    for( auto it = vOperationList.begin(); it != vOperationList.end(); it++ ){
        if( *it == pPlugin )
            vOperationList.erase(it);
    }
}

void StreamOperationSlot::StreamRunning( void * pData, size_t length , unsigned bit_pre_sample, unsigned channels, unsigned rate ){

     for( unsigned i = 0; i < vOperationList.size(); i++ ){
         if( !vOperationList[i]->StreamRunning( pData, length, bit_pre_sample, channels, rate ) ){
             return;//throw
         }
     }

}

StreamOperationSlot::~StreamOperationSlot() {
	// TODO Auto-generated destructor stub
    vOperationList.clear();
}
